#include <iostream>
using namespace std;

const int count[] = {0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};

int GetDayNumber(int date)
{
    int year = date / 10000;
    int month = (date % 10000) / 100;
    int day = date % 100;
    int sum = count[month] + day;
    if(month > 2 && year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
    sum++;

    return sum;
}

int main() {
    int date1 = 0, date2 = 0;
    while(cin >> date1 >> date2)
    {
        if(date1 > date2)
        {
            date2 = date1^date2;
            date1 = date1^date2;
            date2 = date1^date2;
        }

        int sum = GetDayNumber(date2) - GetDayNumber(date1) + 1;
        date1 /= 10000;
        date2 /= 10000;
        
        for(;date1 < date2; date1++)
        {
            sum += 365;
            if(date1 % 400 == 0 || (date1 % 4 == 0 && date1 % 100 != 0))
            sum++;
        }

        cout << sum << endl;
    }
}